include_defs("//ReactAndroid/DEFS")

EXPORTED_HEADERS = [
    "CxxModuleWrapper.h",
    "CxxModuleWrapperBase.h",
    "CxxSharedModuleWrapper.h",
    "JavaModuleWrapper.h",
    "JSLoader.h",
    "MethodInvoker.h",
    "ModuleRegistryBuilder.h",
    "NativeArray.h",
    "NativeCommon.h",
    "NativeMap.h",
    "ReadableNativeArray.h",
    "ReadableNativeMap.h",
    "WritableNativeArray.h",
    "WritableNativeMap.h",
]

cxx_library(
    name = "jni",
    srcs = glob(["*.cpp"]),
    compiler_flags = [
        "-Wall",
        "-Werror",
        "-fexceptions",
        "-std=c++1y",
        "-frtti",
        "-Wno-pessimizing-move",
        "-Wno-inconsistent-missing-override",
    ],
    exported_headers = EXPORTED_HEADERS,
    header_namespace = "xreact/jni",
    headers = glob(
        ["*.h"],
        excludes = EXPORTED_HEADERS,
    ),
    preprocessor_flags = [
        "-DLOG_TAG=\"ReactNativeJNI\"",
        "-DWITH_FBSYSTRACE=1",
        "-DWITH_INSPECTOR=1",
    ],
    soname = "libreactnativejnifb.$(ext)",
    visibility = [
        "PUBLIC",
    ],
    xcode_public_headers_symlinks = True,
    deps = JSC_DEPS + [
        "//native/third-party/android-ndk:android",
        "//xplat/folly:molly",
        "//xplat/fbgloginit:fbgloginit",
        "//xplat/fbsystrace:fbsystrace",
        react_native_xplat_target("cxxreact:bridge"),
        react_native_xplat_target("cxxreact:module"),
        FBJNI_TARGET,
    ],
)
